package com.culture.bootdemo.model.enums;

import com.culture.bootdemo.utils.EnumUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;
import java.util.Map;

@Getter
@AllArgsConstructor
public enum DemoEnum {

    NumberClean(1, "号码检测", "number_clean"),
    IVR(2, "无交互语音通知", "ivr_call"),
    SMS(3, "短信", "sms"),
    AI(4, "联络机器人", "ai_call"),
    ;

    private Integer code;
    private String msg;
    private String billingField;


    public static void main(String[] args) {
        DemoEnum enumByCode = EnumUtil.getEnumByCode(DemoEnum.class, 1);
        System.out.println(enumByCode);

        String message = EnumUtil.getMessage(DemoEnum.class, 0);
        System.out.println(message);

        Map<String, DemoEnum> enumMap = EnumUtil.getEnumMap(DemoEnum.class);
        System.out.println(enumMap.get("AI"));

        List<DemoEnum> enumList = EnumUtil.getEnumList(DemoEnum.class);
        System.out.println(enumList.get(0).msg);
    }
}
